Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move nltk download to inside the gender augmentation function #93

Merged
merged 5 commits into from
Mar 2, 2024

Conversation

yosukehigashi
Copy link
Contributor

This ensures that nltk.download will only run when augment.gender is actually run, rather than when import langcheck is run.

@yosukehigashi yosukehigashi requested a review from liwii February 29, 2024 09:17
Copy link
Contributor

@liwii liwii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the changes, let me suggest one more thing for this PR:

Found that actually the right patyh for nltk.data.find and nltk.download are different. That's why the code always takes except LookupError and shows the nltk log like that.

[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data]     /home/vscode/nltk_data...
[nltk_data]   Package averaged_perceptron_tagger is already up-to-
[nltk_data]       date!
[nltk_data] Downloading package punkt to /home/vscode/nltk_data...
[nltk_data]   Package punkt is already up-to-date!```

[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data] /home/vscode/nltk_data...
[nltk_data] Package averaged_perceptron_tagger is already up-to-
[nltk_data] date!
[nltk_data] Downloading package punkt to /home/vscode/nltk_data...
[nltk_data] Package punkt is already up-to-date!


Could you double-check that my two suggestions resolve the problem?

@yosukehigashi
Copy link
Contributor Author

LGTM for the changes, let me suggest one more thing for this PR:

Found that actually the right patyh for nltk.data.find and nltk.download are different. That's why the code always takes except LookupError and shows the nltk log like that.

[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data]     /home/vscode/nltk_data...
[nltk_data]   Package averaged_perceptron_tagger is already up-to-
[nltk_data]       date!
[nltk_data] Downloading package punkt to /home/vscode/nltk_data...
[nltk_data]   Package punkt is already up-to-date!```

[nltk_data] Downloading package averaged_perceptron_tagger to [nltk_data] /home/vscode/nltk_data... [nltk_data] Package averaged_perceptron_tagger is already up-to- [nltk_data] date! [nltk_data] Downloading package punkt to /home/vscode/nltk_data... [nltk_data] Package punkt is already up-to-date!


Could you double-check that my two suggestions resolve the problem?

ohhh yeah good find!! We were doing this properly for stats and factual consistency 😅 Checked that your suggestions work

@yosukehigashi yosukehigashi merged commit 89b4d6c into main Mar 2, 2024
14 checks passed
@yosukehigashi yosukehigashi deleted the nltk-download branch March 2, 2024 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants